<template>
	<view>
		<Header title="协议详情" :showBack="true"></Header>
		<view class="container">
			<view class="content">
				<view class="title">{{article.title}}</view>
				<text class="cont">{{article.knowledgeContent}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				article:{}
			}
		},
		onLoad(e) {
			this.getList(e.id)
		},
		methods:{
			getList(id){
				this.$http('/service/api/milkKnowledge/info?id='+id,{},res=>{
					if(res.data.succeeded === true){
						this.article = res.data.data
						this.turn(this.article.knowledgeContent)
					}
				})
			},
			turn(data) {
			    return data.replace(/(\r\n|\n|\r)/gm, "<br/>");
			}
		}
	}
</script>

<style lang="less">
	.content{
		background: #fff;
		border-radius: 16upx;
		padding: 20upx 20upx 160upx;
		// box-shadow: 0 0 15upx rgba(247, 200, 122, .2);
		box-shadow: 0 3upx 20upx 1upx rgba(247, 200, 122, .2);
		.title{
			font-size: 40upx;
			font-weight: bold;
			margin-bottom: 20upx;
		}
		.cont{
			font-size: 28upx;
			letter-spacing: 2upx;
			text-align: justify;
			line-height: 40upx;
		}
	}
</style>